"use client"
import { createContext, useContext, useMemo, useState } from "react";

// 定义类型
export type BoxData = {
  id: string;
  type?: string;
  parentId: string;
  customProps?: Record<string, unknown>;
};

interface NodeMapContextType {
  boxData: Map<string, BoxData>;  // { [over.id]: BoxData }
  boxIndex: Record<string, string[]>; // { [over.id]: active.id[] }
  handSetBox: (item: any, monitor: any, parentId: string) => void;
}

// 创建 Context
export const NodeMapContext = createContext<NodeMapContextType | undefined>(undefined);